﻿using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using _2302MVCDemo.Controllers;
using System.Web.Mvc;

namespace UnitTestProject2
{
    [TestClass]
    public class UnitTest1
    {
        [TestMethod]
        public void TestMethod1()
        {
            int sum = 1 + 2;
            Assert.AreEqual(3, sum);
        }

        [TestMethod]
        public void TestMethod2()
        {
            DefaultController controller = new DefaultController(); 
            ViewResult result = controller.Home() as ViewResult;
            Assert.AreEqual("李四", result.ViewBag.name);
        }
    }
}
